\hypertarget{server_8c}{}\section{server/server.c File Reference}
\label{server_8c}\index{server/server.\+c@{server/server.\+c}}


Network test client This code receives a message and displays iit.  


{\ttfamily \#include \char`\"{}user\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdint.\+h$>$}\\*
{\ttfamily \#include $<$stdarg.\+h$>$}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include $<$math.\+h$>$}\\*
{\ttfamily \#include \char`\"{}display/ili9341.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}network/network.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}server/server.\+h\char`\"{}}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{server_8c_a2533774d0ba0505b1b90502bdf8b0c9c}{S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT}~1
\item 
\#define \hyperlink{server_8c_ad74125223df99954750abebacd84a138}{M\+A\+X\+\_\+\+C\+O\+N\+NS}~5
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{server_8c_aa4a250922085a8685fc1056dbdbd89dd}{servertest\+\_\+message} (\hyperlink{structwindow}{window} $\ast$win)
\begin{DoxyCompactList}\small\item\em Network receive task. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{server_8c_a6868f619a2b0ed58a4d155c5a458fccb}{servertest\+\_\+receive} (void $\ast$arg, char $\ast$pdata, unsigned short len)
\begin{DoxyCompactList}\small\item\em Network receive task. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{server_8c_ac0a4b06c201a20489dee20d65ad6f4f0}{servertest\+\_\+setup} (int port)
\begin{DoxyCompactList}\small\item\em Setup Server Task. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static struct espconn $\ast$ \hyperlink{server_8c_a0612433c605a45ae10bbdf503ef3f236}{T\+C\+P\+\_\+\+Server}
\item 
\hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} \hyperlink{server_8c_a15506d9f599b33b151e5efc4fdbe7021}{network\+\_\+msg} \mbox{[}256\mbox{]}
\item 
static \hyperlink{server_8c_a082fd9f55493d749cafc1e11ad84a2b6}{received} = 0
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Network test client This code receives a message and displays iit. 

\begin{DoxyParagraph}{Copyright \copyright{} 2015 Mike Gore, G\+PL License}

\end{DoxyParagraph}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 

\subsection{Macro Definition Documentation}
\index{server.\+c@{server.\+c}!M\+A\+X\+\_\+\+C\+O\+N\+NS@{M\+A\+X\+\_\+\+C\+O\+N\+NS}}
\index{M\+A\+X\+\_\+\+C\+O\+N\+NS@{M\+A\+X\+\_\+\+C\+O\+N\+NS}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{M\+A\+X\+\_\+\+C\+O\+N\+NS}{MAX_CONNS}}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\+A\+X\+\_\+\+C\+O\+N\+NS~5}\hypertarget{server_8c_ad74125223df99954750abebacd84a138}{}\label{server_8c_ad74125223df99954750abebacd84a138}


Definition at line 45 of file server.\+c.

\index{server.\+c@{server.\+c}!S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT@{S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT}}
\index{S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT@{S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT}{SERVER_TIMEOUT}}]{\setlength{\rightskip}{0pt plus 5cm}\#define S\+E\+R\+V\+E\+R\+\_\+\+T\+I\+M\+E\+O\+UT~1}\hypertarget{server_8c_a2533774d0ba0505b1b90502bdf8b0c9c}{}\label{server_8c_a2533774d0ba0505b1b90502bdf8b0c9c}


Definition at line 44 of file server.\+c.



Referenced by servertest\+\_\+setup().



\subsection{Function Documentation}
\index{server.\+c@{server.\+c}!servertest\+\_\+message@{servertest\+\_\+message}}
\index{servertest\+\_\+message@{servertest\+\_\+message}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{servertest\+\_\+message(window $\ast$win)}{servertest_message(window *win)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void servertest\+\_\+message (
\begin{DoxyParamCaption}
\item[{{\bf window} $\ast$}]{win}
\end{DoxyParamCaption}
)}\hypertarget{server_8c_aa4a250922085a8685fc1056dbdbd89dd}{}\label{server_8c_aa4a250922085a8685fc1056dbdbd89dd}


Network receive task. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$win} & window pointer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 56 of file server.\+c.



Referenced by user\+\_\+loop().

\index{server.\+c@{server.\+c}!servertest\+\_\+receive@{servertest\+\_\+receive}}
\index{servertest\+\_\+receive@{servertest\+\_\+receive}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{servertest\+\_\+receive(void $\ast$arg, char $\ast$pdata, unsigned short len)}{servertest_receive(void *arg, char *pdata, unsigned short len)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void servertest\+\_\+receive (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{arg, }
\item[{char $\ast$}]{pdata, }
\item[{unsigned short}]{len}
\end{DoxyParamCaption}
)}\hypertarget{server_8c_a6868f619a2b0ed58a4d155c5a458fccb}{}\label{server_8c_a6868f619a2b0ed58a4d155c5a458fccb}


Network receive task. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$arg} & network callback arg \\
\hline
\mbox{\tt in}  & {\em $\ast$pdata} & data buffer \\
\hline
\mbox{\tt in}  & {\em len} & buffer length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 81 of file server.\+c.



Referenced by servertest\+\_\+setup().

\index{server.\+c@{server.\+c}!servertest\+\_\+setup@{servertest\+\_\+setup}}
\index{servertest\+\_\+setup@{servertest\+\_\+setup}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{servertest\+\_\+setup(int port)}{servertest_setup(int port)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void servertest\+\_\+setup (
\begin{DoxyParamCaption}
\item[{int}]{port}
\end{DoxyParamCaption}
)}\hypertarget{server_8c_ac0a4b06c201a20489dee20d65ad6f4f0}{}\label{server_8c_ac0a4b06c201a20489dee20d65ad6f4f0}


Setup Server Task. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em port} & T\+CP port for service Credits\+: ideas borrowed from David Ogilvy(\+Metal\+Phreak) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 100 of file server.\+c.



Referenced by setup().



\subsection{Variable Documentation}
\index{server.\+c@{server.\+c}!network\+\_\+msg@{network\+\_\+msg}}
\index{network\+\_\+msg@{network\+\_\+msg}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{network\+\_\+msg}{network_msg}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf uint8\+\_\+t} network\+\_\+msg\mbox{[}256\mbox{]}}\hypertarget{server_8c_a15506d9f599b33b151e5efc4fdbe7021}{}\label{server_8c_a15506d9f599b33b151e5efc4fdbe7021}


Definition at line 37 of file server.\+c.



Referenced by servertest\+\_\+message(), servertest\+\_\+receive(), and servertest\+\_\+setup().

\index{server.\+c@{server.\+c}!received@{received}}
\index{received@{received}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{received}{received}}]{\setlength{\rightskip}{0pt plus 5cm}received = 0\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{server_8c_a082fd9f55493d749cafc1e11ad84a2b6}{}\label{server_8c_a082fd9f55493d749cafc1e11ad84a2b6}


Definition at line 48 of file server.\+c.



Referenced by servertest\+\_\+message(), servertest\+\_\+receive(), and servertest\+\_\+setup().

\index{server.\+c@{server.\+c}!T\+C\+P\+\_\+\+Server@{T\+C\+P\+\_\+\+Server}}
\index{T\+C\+P\+\_\+\+Server@{T\+C\+P\+\_\+\+Server}!server.\+c@{server.\+c}}
\subsubsection[{\texorpdfstring{T\+C\+P\+\_\+\+Server}{TCP_Server}}]{\setlength{\rightskip}{0pt plus 5cm}struct espconn$\ast$ T\+C\+P\+\_\+\+Server\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{server_8c_a0612433c605a45ae10bbdf503ef3f236}{}\label{server_8c_a0612433c605a45ae10bbdf503ef3f236}


Definition at line 36 of file server.\+c.



Referenced by servertest\+\_\+receive(), and servertest\+\_\+setup().

